export default class {
  //#region 资产
  getCapitalList(params) {
    return this.request({
      url: "/admin/v1/property/list",
      method: "GET",
      params,
    });
  }
  getCapitalDetail(id) {
    return this.request({
      url: `/admin/v1/property?id=${id}`,
      method: "GET",
    });
  }
  addCapital(data) {
    return this.request({
      url: `/admin/v1/property`,
      method: "PUT",
      data,
    });
  }
  editCapital(id, data) {
    return this.request({
      url: `/admin/v1/property?id=${id}`,
      method: "POST",
      data,
    });
  }
  delCapital(id) {
    return this.request({
      url: `/admin/v1/property?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 资金
  getAssetList(params) {
    return this.request({
      url: "/admin/v1/fund/list",
      method: "GET",
      params,
    });
  }

  getAssetDetail(id) {
    return this.request({
      url: `/admin/v1/fund?id=${id}`,
      method: "GET",
    });
  }

  addAsset(data) {
    return this.request({
      url: `/admin/v1/fund`,
      method: "PUT",
      data,
    });
  }

  editAsset(id, data) {
    return this.request({
      url: `/admin/v1/fund?id=${id}`,
      method: "POST",
      data,
    });
  }
  delAsset(id) {
    return this.request({
      url: `/admin/v1/fund?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion

  //#region 访客
  getVisitorList(params) {
    return this.request({
      url: "/admin/v1/vistor_order/list",
      method: "GET",
      params,
    });
  }
  getVisitorInfo(code) {
    return this.request({
      url: `/admin/v1/vistor_order?qr_code=${code}`,
      method: "GET",
    });
  }

  //#endregion

  //#region 投诉
  getReportRepairList(params) {
    return this.request({
      url: `/admin/v1/complaint/list`,
      method: "GET",
      params,
    });
  }
  getReportRepairInfo(id) {
    return this.request({
      url: `/admin/v1/complaint?id=${id}`,
      method: "GET",
    });
  }
  addReportRepair(data) {
    return this.request({
      url: `/api/admin/complaint/`,
      method: "POST",
      data,
    });
  }
  editReportRepair(id, data) {
    return this.request({
      url: `/admin/v1/complaint?id=${id}`,
      method: "POST",
      data,
    });
  }
  delReportRepair(id) {
    return this.request({
      url: `/api/admin/complaint/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion

  //#region 报修
  getComplaintPraiseList(params) {
    return this.request({
      url: "/admin/v1/report_repair/list",
      method: "GET",
      params,
    });
  }
  getComplaintPraiseInfo(id) {
    return this.request({
      url: `/admin/v1/report_repair?id=${id}`,
      method: "GET",
    });
  }
  addComplaintPraise(data) {
    return this.request({
      url: `/api/admin/report_repair/`,
      method: "POST",
      data,
    });
  }
  editComplaintPraise(id, data) {
    return this.request({
      url: `/admin/v1/report_repair?id=${id}`,
      method: "POST",
      data,
    });
  }
  delComplaintPraise(id) {
    return this.request({
      url: `/admin/v1/report_repair?id=${id}`,
      method: "DELETE",
    });
  }

  giveComplaintPraise(data) {
    return this.request({
      url: `/admin/v1/screen_data/report_assign`,
      method: "POST",
      data,
    });
  }
  //#endregion
}
